Telegram Group & Telegram Channel
✏️ Промпт дня: Следуй стандартам кода в C++

Если необходимо быстро привести код к определённому стилю, то этом случае можно воспользоваться следующим промптом.


🍴 Промпт для AI-помощника:

Rewrite the code below following the Google style guidelines for C++.

[Вставь свой код]



‼️ Пример использования промпта:

Было:

class userManager{
public:
int getUserCount(){return userCount;}
void setUserCount(int count){userCount=count;}
private:
int userCount;
};

void ProcessUserData(){
const int maxUsers=100;
userManager um;
for(int i=0;i<maxUsers;i++){
um.setUserCount(i);
}
}


Стало (после применения Google C++ Style Guide):

class UserManager {
public:
int GetUserCount() const { return user_count_; }
void SetUserCount(int count) { user_count_ = count; }

private:
int user_count_;
};

void ProcessUserData() {
const int MAX_USERS = 100;
UserManager user_manager;

for (int i = 0; i < MAX_USERS; ++i) {
user_manager.SetUserCount(i);
}
}


Что изменилось:

Функции в CamelCase
Переменные в snake_case
Константы в UPPER_CASE
Правильные отступы и пробелы


⛄️ А каким стилем для кода вы пользуетесь? Пишите в комментариях.

Библиотека C/C++ разработчика #буст
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/cppproglib/5784
Create:
Last Update:

✏️ Промпт дня: Следуй стандартам кода в C++

Если необходимо быстро привести код к определённому стилю, то этом случае можно воспользоваться следующим промптом.


🍴 Промпт для AI-помощника:

Rewrite the code below following the Google style guidelines for C++.

[Вставь свой код]



‼️ Пример использования промпта:

Было:

class userManager{
public:
int getUserCount(){return userCount;}
void setUserCount(int count){userCount=count;}
private:
int userCount;
};

void ProcessUserData(){
const int maxUsers=100;
userManager um;
for(int i=0;i<maxUsers;i++){
um.setUserCount(i);
}
}


Стало (после применения Google C++ Style Guide):

class UserManager {
public:
int GetUserCount() const { return user_count_; }
void SetUserCount(int count) { user_count_ = count; }

private:
int user_count_;
};

void ProcessUserData() {
const int MAX_USERS = 100;
UserManager user_manager;

for (int i = 0; i < MAX_USERS; ++i) {
user_manager.SetUserCount(i);
}
}


Что изменилось:

Функции в CamelCase
Переменные в snake_case
Константы в UPPER_CASE
Правильные отступы и пробелы


⛄️ А каким стилем для кода вы пользуетесь? Пишите в комментариях.

Библиотека C/C++ разработчика #буст

BY Библиотека C/C++ разработчика | cpp, boost, qt


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/cppproglib/5784

View MORE
Open in Telegram


Библиотека C C разработчика | cpp boost qt Telegram | DID YOU KNOW?

Date: |

The lead from Wall Street offers little clarity as the major averages opened lower on Friday and then bounced back and forth across the unchanged line, finally finishing mixed and little changed.The Dow added 33.18 points or 0.10 percent to finish at 34,798.00, while the NASDAQ eased 4.54 points or 0.03 percent to close at 15,047.70 and the S&P 500 rose 6.50 points or 0.15 percent to end at 4,455.48. For the week, the Dow rose 0.6 percent, the NASDAQ added 0.1 percent and the S&P gained 0.5 percent.The lackluster performance on Wall Street came on uncertainty about the outlook for the markets following recent volatility.

In many cases, the content resembled that of the marketplaces found on the dark web, a group of hidden websites that are popular among hackers and accessed using specific anonymising software.“We have recently been witnessing a 100 per cent-plus rise in Telegram usage by cybercriminals,” said Tal Samra, cyber threat analyst at Cyberint.The rise in nefarious activity comes as users flocked to the encrypted chat app earlier this year after changes to the privacy policy of Facebook-owned rival WhatsApp prompted many to seek out alternatives.Библиотека C C разработчика | cpp boost qt from us


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM USA